//
//  HelloWorldLayer.m
//  cocos2d0.99
//
//  Created by wu di on 11-7-13.
//  Copyright UTS 2011. All rights reserved.
//

// Import the interfaces
#import "HelloWorldScene.h"
#import "ObjcppTest.hpp"
// HelloWorld implementation
@implementation HelloWorld

+(id) scene
{
	// 'scene' is an autorelease object.
	CCScene *scene = [CCScene node];
	
	// 'layer' is an autorelease object.
	HelloWorld *layer = [HelloWorld node];
	
	// add layer as a child to scene
	[scene addChild: layer];
	
	// return the scene
	return scene;
}

// on "init" you need to initialize your instance
-(id) init
{
	// always call "super" init
	// Apple recommends to re-assign "self" with the "super" return value
	if( (self=[super init] )) {
		
		// create and initialize a Label		
		
		CGSize size = [[CCDirector sharedDirector] winSize];
		ObjcppTest *test = [[ObjcppTest alloc] initWithCGSize:size];
		//ObjTest *ot = [test GetObject];
		CGSize cs = [test GetCGSize];
		CCSprite *player = [CCSprite spriteWithFile:@"Player.png" rect:CGRectMake(0, 0, 27, 40)];
		//player.position = ccp(player.contentSize.width/2, winSize.height/2);
//		obj.cp.position = ccp(50,100);
		player.position = ccp(50,100);
		[self addChild:player];							
	}
	return self;
}

// on "dealloc" you need to release all your retained objects
- (void) dealloc
{
	// in case you have something to dealloc, do it in this method
	// in this particular example nothing needs to be released.
	// cocos2d will automatically release all the children (Label)
	
	// don't forget to call "super dealloc"
	[super dealloc];
}
@end
